USE [HomestayWebDB]
GO
/****** Object:  StoredProcedure [dbo].[Store_Posts_ChangeAvaliable]    Script Date: 11/26/2012 17:33:02 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER PROC [dbo].[Store_Posts_ChangeAvaliable]
(
	@PostID int
)
AS

UPDATE Posts SET IsAvailable = ( CASE WHEN IsAvailable = CAST(0 AS BIT) THEN CAST(1 AS BIT)
									WHEN IsAvailable = CAST(1 AS BIT) THEN  CAST(0 AS BIT)
								END
							 )
WHERE postID = @PostID
